import { Entity, PrimaryGeneratedColumn, Column, Unique } from "typeorm";

@Entity("vip_status")
@Unique(["characterId"])
export class VipStatusEntity {
  @PrimaryGeneratedColumn()
  id!: number;

  @Column("int", { name: "characterId" })
  characterId!: number;

  @Column("int", { default: 0, comment: "VIP 等级" })
  vipLevel!: number;

  @Column("int", { default: 0, comment: "VIP 累计经验" })
  vipExp!: number;

  @Column("varchar", {
    length: 10,
    nullable: true,
    comment: "每日VIP经验领取日期（YYYY-MM-DD）",
  })
  dailyClaimDate!: string | null;

  @Column("datetime", { name: "created_at", comment: "创建时间" })
  created_at!: Date;

  @Column("datetime", {
    name: "updated_at",
    nullable: true,
    comment: "更新时间",
  })
  updated_at!: Date | null;
}
